//
// Created by liushuai on 2021/2/22.
//

#include "detectCapitalUse.h"
<<<<<<< HEAD:cxx/algorithm/src/detectCapitalUse.cc
bool detectCapitalUse(string word){
    if(word.empty())
        return false;
    int count = 0;
    for(auto e:word){
        if(e>='A' && e<='Z')
            ++count;
    }
    if(count==word.size()||((count==1)&&(word[0]>='A'&&word[0]<='Z'))||(count==0))
        return true;
    else
        return false;
=======
bool detectCapitalUse(string word) {
  if (word.empty()) return false;
  int count = 0;
  for (auto e : word) {
    if (e >= 'A' && e <= 'Z') ++count;
  }
  if (count == word.size() ||
      ((count == 1) && (word[0] >= 'A' && word[0] <= 'Z')) || (count == 0))
    return true;
  else
    return false;
>>>>>>> dev:cxx/algorithm/common/src/detectCapitalUse.cc
}